package com.example.springfeature.springinitbean;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created with IDEA
 *
 * @author: 董文辉
 * Date: 2019/3/8
 * Time: 10:03
 */

@Component
public class BeanPhone {
    private String brandName ="华为";
    private Integer money = 1000;

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    @Override
    public String toString() {
        return "Phone{" +
                "brandName='" + brandName + '\'' +
                ", money=" + money +
                '}';
    }
    @Bean
    public void doInit(){
        System.out.println("BeanPhone 创建完成后第一步操作");
    }

    @Bean
    public void doInit1(){
        System.out.println("BeanPhone 创建完成后第二部操作");
    }

    @PostConstruct
    public void doInit3(){
        System.out.println("BeanPhone 创建完成后第三部操作");
    }


}
